package com.tencent.wxcloudrun.constant;

/**
 * @author Ryan Zhao
 *         <p>
 *         Copyright: Copyright (c) 2023
 *         </p>
 * @version 1.0
 * @date 2023-09-13 15:24
 * @description: Redis键常量
 */
public class RedisKeyConstant {

    /**
     * 用户信息
     */
    public static final String USER = "USER:USER:";

    /**
     * 用户微信信息
     */
    public static final String USER_OPEN_ID = "USER:USER_OPEN_ID:";

    /**
     * 用户卡片信息
     */
    public static final String USER_CARD = "USER:USER_CARD:";

    /**
     * 商家商品信息
     */
    public static final String STORE_PROD = "STORE:STORE_PROD:";

    /**
     * 活动信息
     */
    public static final String ACTI_INFO = "ACTI:ACTI_INFO:";

    /**
     * 活动列表
     */
    public static final String ACTI_LIST = "ACTI:ACTI_LIST";

    /**
     * 活动状态
     */
    public static final String ACTI_STATUS = "ACTI:ACTI_STATUS:";

    /**
     * 活动入围状态
     */
    public static final String ACTI_SELECTED_STATUS = "ACTI:ACTI_SELECTED_STATUS:";

    /**
     * 活动黑箱状态
     */
    public static final String ACTI_BLACK_STATUS = "ACTI:ACTI_BLACK_STATUS:";

    /**
     * 活动参选锁
     */
    public static final String ACTI_JOIN_LOCK = "ACTI_USER_JOIN:ACTI_JOIN_LOCK:";

    /**
     * 活动商品参选锁
     */
    public static final String ACTI_PROD_JOIN_LOCK = "ACTI_USER_JOIN:ACTI_PROD_JOIN_LOCK:";

    /**
     * 活动参选状态
     */
    public static final String ACTI_JOIN_STATUS = "ACTI_USER_JOIN:ACTI_JOIN_STATUS:";

    /**
     * 活动参选商品库存
     */
    public static final String ACTI_JOIN_STOCK = "ACTI_USER_JOIN:ACTI_JOIN_STOCK:";

    /**
     * 活动参选号码
     */
    public static final String ACTI_JOIN_NUMBER = "ACTI_USER_JOIN:ACTI_JOIN_NUMBER:";

    /**
     * 活动入围库存
     */
    public static final String ACTI_SELECT_STOCK = "ACTI_USER_JOIN:ACTI_SELECT_STOCK:";

    /**
     * 活动入围号码
     */
    public static final String ACTI_SELECT_NUMBER = "ACTI_USER_JOIN:ACTI_SELECT_NUMBER:";

    /**
     * 活动黑箱库存
     */
    public static final String ACTI_BLACK_STOCK = "ACTI_USER_JOIN:ACTI_BLACK_STOCK:";

    /**
     * 订单信息
     */
    public static final String ORDER_INFO = "ORDER:ORDER_INFO:";

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [userId]
     * @Return: String
     * @Description: 用户信息
     */
    public static String getUserRedisKey(Long userId) {
        return USER + userId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/6/11
     * @Params: [wxOpenId]
     * @Return: String
     * @Description: 用户微信信息
     */
    public static String getUserOpenIdRedisKey(String wxOpenId) {
        return USER_OPEN_ID + wxOpenId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [userId]
     * @Return: String
     * @Description: 用户卡片信息
     */
    public static String getUserCardRedisKey(Long userId) {
        return USER_CARD + userId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [prodId]
     * @Return: String
     * @Description: 商家商品信息
     */
    public static String getStoreProdRedisKey(Long prodId) {
        return STORE_PROD + prodId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动信息
     */
    public static String getActiInfoRedisKey(Long actiId) {
        return ACTI_INFO + actiId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动状态
     */
    public static String getActiStatusRedisKey(Long actiId) {
        return ACTI_STATUS + actiId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动状态
     */
    public static String getActiSelectedStatusRedisKey(Long actiId) {
        return ACTI_SELECTED_STATUS + actiId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动状态
     */
    public static String getActiBlackStatusRedisKey(Long actiId) {
        return ACTI_BLACK_STATUS + actiId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动参选锁
     */
    public static String getActiJoinLockRedisKey(Long actiId) {
        return ACTI_JOIN_LOCK + ":" + actiId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动商品参选锁
     */
    public static String getActiJoinProdLockRedisKey(Long actiId, Long prodId, Long prodAttrId) {
        return ACTI_PROD_JOIN_LOCK + actiId + ":" + prodId + "-" + prodAttrId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId, userId]
     * @Return: String
     * @Description: 活动参选状态
     */
    public static String getActiJoinStatusRedisKey(Long actiId, Long userId) {
        return ACTI_JOIN_STATUS + actiId + ":" + userId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId, prodId, prodAttrId]
     * @Return: String
     * @Description: 活动商品库存
     */
    public static String getActiJoinStockRedisKey(Long actiId, Long prodId, Long prodAttrId) {
        return ACTI_JOIN_STOCK + actiId + ":" + prodId + "-" + prodAttrId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId, prodId, prodAttrId]
     * @Return: String
     * @Description: 活动参选号码
     */
    public static String getActiJoinNumberRedisKey(Long actiId, Long prodId, Long prodAttrId) {
        return ACTI_JOIN_NUMBER + actiId + ":" + prodId + "-" + prodAttrId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动入围库存
     */
    public static String getActiSelectedStockRedisKey(Long actiId) {
        return ACTI_SELECT_STOCK + actiId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动入围号码
     */
    public static String getActiSelectedNumberRedisKey(Long actiId) {
        return ACTI_SELECT_NUMBER + actiId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [actiId]
     * @Return: String
     * @Description: 活动黑箱库存
     */
    public static String getActiBlackStockRedisKey(Long actiId) {
        return ACTI_BLACK_STOCK + actiId;
    }

    /**
     * @Author: ZhaoZiYin
     * @Date: 2025/4/27
     * @Params: [orderId]
     * @Return: String
     * @Description: 订单信息
     */
    public static String getOrderInfoRedisKey(Long orderId) {
        return ORDER_INFO + orderId;
    }

}
